import os
import re

"""
    手动停止monkey进程
"""


content = os.popen("adb shell ps | findstr monkey")
pid = 0
for line in content.readlines():
    pid_pattern = re.compile(r'\d+\b')
    pid = pid_pattern.findall(line)[0]
os.system("adb shell kill " + str(pid))